1. Field of the Invention
This invention relates generally to processors. More particularly, it relates to an efficient system for combining the functions of two types of processors, e.g., both a digital signal processor and a controller.
2. Background of Related Art
As electronic circuitry in general, and telephone systems in particular, become more advanced, design implementations for the various designs typically make use of two separate processors working in conjunction with one another. One of these processors is invariably a Digital Signal Processor (DSP) which is typically responsible for running logic necessary for signal processing and related tasks, and the other is a suitable controller (e.g., a microcontroller) focused on the overall control of the device.
FIG. 5 shows a conventional two-processor device including both a digital signal processor (DSP) and a microcontroller, each having its own program code.
In particular, in FIG. 5, a device 200 such as a telephone device (e.g., telephone answering device, etc.) includes both a DSP 202 and a microcontroller 204. The DSP 202 communicates information to and from the microcontroller 204 via a suitable communication interface 206, e.g., a serial or parallel communication interface.
DSP program code 210 is stored in memory accessible to the DSP 202, and microcontroller code 212 is stored in memory accessible to the microcontroller 204.
A controller in a two-processor system, e.g., the microcontroller 204, typically runs as a xe2x80x98masterxe2x80x99 processor of the system, taking care of the control of the peripherals in the device or system 200. A second processor, often a DSP 202, runs in a xe2x80x98slavexe2x80x99 mode, mastered by the microcontroller 204. Using communications between the DSP 202 and the microcontroller 204 provided by the communication interface 206, appropriate signal processing tasks are typically handled by the DSP 202 operating as a slave device, while xe2x80x98feature codexe2x80x99 for the system 200 typically runs on the microcontroller 204 operating as a master device.
An example of a suitable microcontroller 204 often used in a two-processor system is the industry standard microcontroller known as the xe2x80x9c8051xe2x80x9d microcontroller, which is commercially available in various forms from, e.g., lntel(trademark) and Phillips(trademark).
The 8051 microcontroller is, and has been for nearly two decades, popular among the micro-controller solution provider community. As a result, the 8051 is well supported in the industry, having advanced tools available such as assemblers, C compilers, etc. Moreover, code fragments are widely available for the 8051, e.g., from various sources over the Internet.
In many applications such as that depicted in FIG. 5, the DSP 202 is the center of operations. However, as pressures for reduced cost and smaller size persist, design solutions tend toward use of only one processor, e.g., toward use of only the DSP 202. In such applications, control responsibilities of what would otherwise fall within the requirements of the microcontroller 204 in the two-processor solution are left for the DSP 202 alone to handle in the one-processor solution. Moreover, the software code written for the DSP 202 need control peripheral components and run feature code apart from carrying out its more traditional responsibilities typically associated with standard signal processing tasks. Such control tasks, most efficiently handled by a suitable microcontroller but instead implemented on a DSP in a one-processor device, tend to become cumbersome and inefficient when implemented in DSP code.
For instance, the instruction set of a DSP, while optimized to efficiently encode signal processing algorithms, typically requires an excessive amount of code to handle control functions. This is disadvantageous by its very nature, particularly in the case of one-processor solutions wherein code memory space that a programmer can use is at a premium. This is especially true with low end microcontrollers. Moreover, programmers more conversant with DSP code development may find control tasks somewhat xe2x80x9cunfamiliarxe2x80x9d, and vice versa.
There is thus a need for a more efficient technique and apparatus for combining the functions traditionally accomplished by two types of processors, e.g., a digital signal processor and a controller, such that programmers will program efficiently, and generate code easily and with minimum size requirements will be at a minimum.
In accordance with the principles of the present invention, a two processor solution using only one processor comprises a host processor, and a run-time emulation module implemented for emulation of an emulated processor different from the host processor, within the host processor. An operating system allows substantially simultaneous operation of a first program written in host processor code to operate in the host processor and a second program written in processor code for the emulated processor, the host processor code being substantially different from the emulated processor code.
A method of implementing two software programs written in different native languages to be operated on a single processor in real time in accordance with another aspect of the present invention comprises providing a digital signal processor, and a run-time emulation module in the digital signal processor to emulate an emulated processor within the digital signal processor. Program code associated with the digital signal processor is stored in a first portion of program memory accessible by the digital signal processor. Program code associated with the emulated processor is stored in a second portion of the program memory. A host line of program code is retrieved and executed for the digital signal processor, and an emulated line of program code is retrieved and executed for the run-time emulation module.